<template>
    <div class="b-cont">
        <div>
            <head-section v-for="(mainItem, mainIndex) in list" :key="mainIndex" :label="mainItem.name" :props="{
                headBgColor: '#FAFBFC',
                arrows: 'left',
                border: false,
                bodyPadding: '0'
            }" class="b-cells">
                <flexbox :gutter="0" style="margin-top: 16px;" align="stretch" wrap="wrap">
                    <flexbox-item v-for="(item, index) in mainItem.list" :key="index">
                        <flexbox v-if="item.formType == 'map_address'" :gutter="0" wrap="wrap">
                            <flexbox-item :span="getShowBlock(item.formType) ? 12 : 0.5" class="b-cell">
                                <flexbox class="b-cell-b" align="stretch">
                                    <div class="b-cell-name">定位</div>
                                    <div class="b-cell-value" style="color: #3e84e9;cursor: pointer;">{{ item.value.location
                                    }}</div>
                                </flexbox>
                            </flexbox-item>
                            <flexbox-item :span="0.5" class="b-cell">
                                <flexbox class="b-cell-b" align="stretch">
                                    <div class="b-cell-name">区域</div>
                                    <div class="b-cell-value">{{ item.value.address }}</div>
                                </flexbox>
                            </flexbox-item>
                            <flexbox-item :span="0.5" class="b-cell">
                                <flexbox class="b-cell-b" align="stretch">
                                    <div class="b-cell-name">详细地址</div>
                                    <div class="b-cell-value">{{ item.value.detailAddress }}</div>
                                </flexbox>
                            </flexbox-item>
                        </flexbox>

                        <flexbox v-else-if="item.formType == 'single_user'" align="stretch" class="b-cell-b">
                            <div class="b-cell-name">{{ item.name }}</div>
                            <div class="b-cell-value">{{ item.value ? item.value.realname : '' }}</div>
                        </flexbox>

                        <flexbox v-else-if="isModule(item)" align="stretch" class="b-cell-b">
                            <div class="b-cell-name">{{ item.name }}</div>
                            <div class="b-cell-value can-check" @click="checkModuleDetail(item)">
                            </div>
                        </flexbox>

                        <flexbox
                            v-else-if="item.formType == 'checkbox' || item.formType == 'structure' || item.formType == 'user'"
                            align="stretch" class="b-cell-b">
                            <div class="b-cell-name">{{ item.name }}</div>
                            <div class="b-cell-value">123</div>
                        </flexbox>

                        <flexbox v-else-if="item.formType == 'file'" align="stretch" class="b-cell-b">
                            <div class="b-cell-name">{{ item.name }}</div>
                            <div class="b-cell-value">123</div>
                        </flexbox>

                        <flexbox v-else-if="item.formType == 'check_status'" align="stretch" class="b-cell-b">
                            <div class="b-cell-name">{{ item.name }}</div>
                            <div class="b-cell-value">{{ }}</div>
                        </flexbox>

                        <flexbox v-else align="stretch" class="b-cell-b">
                            <div class="b-cell-name">{{ item.name }}</div>
                            <div class="b-cell-value">{{ }}</div>
                        </flexbox>

                    </flexbox-item>
                </flexbox>
            </head-section>
            <slot />
        </div>
        <!-- <map-view
        v-if="showMapView"
        :title="mapViewInfo.title"
        :lat="mapViewInfo.lat"
        :lng="mapViewInfo.lng"
        @hidden="showMapView=false" /> -->

        <full-screen-detail :id="fullDetailId" :visible.sync="showFullDetail" :crm-type="fullDetailType" />
    </div>
</template>
  
<script>
//   import crmTypeModel from '@/views/crm/model/crmTypeModel'
import HeadSection from '@/components/HeadSection'
//   import { filedGetInformationAPI } from '@/api/crm/common'
//   import MapView from '@/components/MapView' // 地图详情
//   import FileListView from '@/components/FileListView'
//   import { crmMarketingInformationAPI } from '@/api/crm/marketing'
//   import CheckStatusMixin from '@/mixins/CheckStatusMixin'

import { separator } from '@/filters/vueNumeralFilter/filters'
// import { isObject } from '@/utils/types'
// import { getWkDateTime } from '@/utils'

export default {
    // 客户管理 的 基本信息
    name: 'BasicInformation',
    components: {
        HeadSection,
        //   MapView,
        //   FileListView,
        FullScreenDetail: () => import('@/components/FullScreenDetail')
    },
    filters: {
        // arrayValue(array, field) {
        //     if (
        //         !array ||
        //         Object.prototype.toString.call(array) !== '[object Array]'
        //     ) {
        //         return ''
        //     }

        //     return array
        //         .map(item => {
        //             return field ? item[field] : item
        //         })
        //         .join('，')
        // }
    },
    // mixins: [CheckStatusMixin],
    props: {
        // 模块ID
        id: [String, Number],
        poolId: [String, Number],
        detail: {
            type: Object,
            default: () => {
                return {}
            }
        },
        // 没有值就是全部类型 有值就是当个类型
        crmType: {
            type: String,
            default: ''
        },
        // 固定字段的数据
        filedList: Array
    },
    data() {
        return {
            loading: false,
            list: [],
            // 控制展示地图详情
            showMapView: false,
            // 地图详情信息
            mapViewInfo: {},
            showFullDetail: false,
            fullDetailId: '',
            fullDetailType: '',
            dataList: [
                {
                    "fieldId": "1685859946633621528",
                    "parentFieldId": null,
                    "label": 3,
                    "fieldName": "name",
                    "formType": "text",
                    "name": "姓名",
                    "type": 1,
                    "inputTips": null,
                    "maxLength": 255,
                    "defaultValue": "",
                    "isUnique": 0,
                    "isNull": 1,
                    "options": null,
                    "fieldType": 1,
                    "operating": 181,
                    "companyId": "1685859946163859456",
                    "setting": [],
                    "authLevel": 3,
                    "value": "qwer",
                    "sysInformation": null,
                    "isOut": null,
                    "isHidden": 0,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": 0,
                    "stylePercent": 50,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": null,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "name_resourceKey": "customField.contacts.name"
                    },
                    "xaxis": -1,
                    "yaxis": -1
                },
                {
                    "fieldId": "1685859946633621540",
                    "parentFieldId": null,
                    "label": 3,
                    "fieldName": "ownerUserId",
                    "formType": "user",
                    "name": "负责人",
                    "type": 10,
                    "inputTips": null,
                    "maxLength": 255,
                    "defaultValue": [
                        {
                            "userId": "1685859946243551232",
                            "img": null,
                            "realname": "admin",
                            "status": null,
                            "deptId": null,
                            "deptName": null,
                            "wxUserId": null,
                            "outerUserEmail": null
                        }
                    ],
                    "isUnique": 0,
                    "isNull": 1,
                    "options": null,
                    "fieldType": 1,
                    "operating": 16,
                    "companyId": "1685859946163859456",
                    "setting": null,
                    "authLevel": 3,
                    "value": [
                        {
                            "userId": "1685859946243551232",
                            "img": null,
                            "realname": "admin",
                            "status": 1,
                            "deptId": "1685859946201608192",
                            "deptName": "admin",
                            "wxUserId": null,
                            "outerUserEmail": null
                        }
                    ],
                    "sysInformation": null,
                    "isOut": null,
                    "isHidden": 0,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": 0,
                    "stylePercent": 50,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": null,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "name_resourceKey": "customField.contacts.ownerUserName"
                    },
                    "xaxis": -1,
                    "yaxis": -1
                },
                {
                    "fieldId": "1685859946633621529",
                    "parentFieldId": null,
                    "label": 3,
                    "fieldName": "customerId",
                    "formType": "customer",
                    "name": "客户名称",
                    "type": 15,
                    "inputTips": null,
                    "maxLength": null,
                    "defaultValue": "",
                    "isUnique": 0,
                    "isNull": 1,
                    "options": null,
                    "fieldType": 1,
                    "operating": 157,
                    "companyId": "1685859946163859456",
                    "setting": [],
                    "authLevel": 3,
                    "value": [
                        {
                            "customerId": "1686200528476184576",
                            "customerName": "去恶趣味"
                        }
                    ],
                    "sysInformation": null,
                    "isOut": null,
                    "isHidden": 0,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": 1,
                    "stylePercent": 50,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": null,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "name_resourceKey": "customField.contacts.customerName"
                    },
                    "xaxis": -1,
                    "yaxis": -1
                },
                {
                    "fieldId": "1685859946633621530",
                    "parentFieldId": null,
                    "label": 3,
                    "fieldName": "mobile",
                    "formType": "mobile",
                    "name": "手机",
                    "type": 7,
                    "inputTips": null,
                    "maxLength": 255,
                    "defaultValue": "",
                    "isUnique": 0,
                    "isNull": 0,
                    "options": null,
                    "fieldType": 1,
                    "operating": 191,
                    "companyId": "1685859946163859456",
                    "setting": [],
                    "authLevel": 3,
                    "value": null,
                    "sysInformation": null,
                    "isOut": null,
                    "isHidden": 0,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": 2,
                    "stylePercent": 50,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": null,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "name_resourceKey": "customField.contacts.mobile"
                    },
                    "xaxis": -1,
                    "yaxis": -1
                },
                {
                    "fieldId": "1685859946633621531",
                    "parentFieldId": null,
                    "label": 3,
                    "fieldName": "telephone",
                    "formType": "text",
                    "name": "电话",
                    "type": 1,
                    "inputTips": null,
                    "maxLength": 255,
                    "defaultValue": "",
                    "isUnique": 0,
                    "isNull": 0,
                    "options": null,
                    "fieldType": 1,
                    "operating": 191,
                    "companyId": "1685859946163859456",
                    "setting": [],
                    "authLevel": 3,
                    "value": "1233",
                    "sysInformation": null,
                    "isOut": null,
                    "isHidden": 0,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": 3,
                    "stylePercent": 50,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": null,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "name_resourceKey": "customField.contacts.telephone"
                    },
                    "xaxis": -1,
                    "yaxis": -1
                },
                {
                    "fieldId": "1685859946633621532",
                    "parentFieldId": null,
                    "label": 3,
                    "fieldName": "email",
                    "formType": "email",
                    "name": "邮箱",
                    "type": 14,
                    "inputTips": null,
                    "maxLength": 255,
                    "defaultValue": "",
                    "isUnique": 0,
                    "isNull": 0,
                    "options": null,
                    "fieldType": 1,
                    "operating": 191,
                    "companyId": "1685859946163859456",
                    "setting": [],
                    "authLevel": 3,
                    "value": null,
                    "sysInformation": null,
                    "isOut": null,
                    "isHidden": 0,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": 4,
                    "stylePercent": 50,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": null,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "name_resourceKey": "customField.contacts.email"
                    },
                    "xaxis": -1,
                    "yaxis": -1
                },
                {
                    "fieldId": "1685859946633621533",
                    "parentFieldId": null,
                    "label": 3,
                    "fieldName": "post",
                    "formType": "text",
                    "name": "职务",
                    "type": 1,
                    "inputTips": null,
                    "maxLength": 255,
                    "defaultValue": "",
                    "isUnique": 0,
                    "isNull": 0,
                    "options": null,
                    "fieldType": 1,
                    "operating": 191,
                    "companyId": "1685859946163859456",
                    "setting": [],
                    "authLevel": 3,
                    "value": null,
                    "sysInformation": null,
                    "isOut": null,
                    "isHidden": 0,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": 5,
                    "stylePercent": 50,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": null,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "name_resourceKey": "customField.contacts.post"
                    },
                    "xaxis": -1,
                    "yaxis": -1
                },
                {
                    "fieldId": "1685859946633621534",
                    "parentFieldId": null,
                    "label": 3,
                    "fieldName": "policymakers",
                    "formType": "select",
                    "name": "是否关键决策人",
                    "type": 3,
                    "inputTips": null,
                    "maxLength": null,
                    "defaultValue": "",
                    "isUnique": 0,
                    "isNull": 0,
                    "options": "是,否",
                    "fieldType": 2,
                    "operating": 190,
                    "companyId": "1685859946163859456",
                    "setting": [
                        "是",
                        "否"
                    ],
                    "authLevel": 3,
                    "value": null,
                    "sysInformation": null,
                    "isOut": null,
                    "isHidden": 0,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": 6,
                    "stylePercent": 50,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": null,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "0": "customField.contacts.policymakersOptions.是",
                        "1": "customField.contacts.policymakersOptions.否",
                        "name_resourceKey": "customField.contacts.policymakers"
                    },
                    "xaxis": -1,
                    "yaxis": -1
                },
                {
                    "fieldId": "1685859946633621535",
                    "parentFieldId": null,
                    "label": 3,
                    "fieldName": "parentContactsId",
                    "formType": "contacts",
                    "name": "直属上级",
                    "type": 17,
                    "inputTips": null,
                    "maxLength": 255,
                    "defaultValue": "",
                    "isUnique": 0,
                    "isNull": 0,
                    "options": null,
                    "fieldType": 1,
                    "operating": 191,
                    "companyId": "1685859946163859456",
                    "setting": [],
                    "authLevel": 3,
                    "value": null,
                    "sysInformation": null,
                    "isOut": null,
                    "isHidden": 0,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": 7,
                    "stylePercent": 50,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": null,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "name_resourceKey": "customField.contacts.parentContactsName"
                    },
                    "xaxis": -1,
                    "yaxis": -1
                },
                {
                    "fieldId": "1685859946633621536",
                    "parentFieldId": null,
                    "label": 3,
                    "fieldName": "address",
                    "formType": "position",
                    "name": "地址",
                    "type": 43,
                    "inputTips": null,
                    "maxLength": 255,
                    "defaultValue": null,
                    "isUnique": 0,
                    "isNull": 0,
                    "options": null,
                    "fieldType": 1,
                    "operating": 191,
                    "companyId": "1685859946163859456",
                    "setting": null,
                    "authLevel": 3,
                    "value": null,
                    "sysInformation": null,
                    "isOut": null,
                    "isHidden": 0,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": 8,
                    "stylePercent": 50,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": 1,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "name_resourceKey": "customField.contacts.address"
                    },
                    "xaxis": -1,
                    "yaxis": -1
                },
                {
                    "fieldId": "1685859946633621537",
                    "parentFieldId": null,
                    "label": 3,
                    "fieldName": "nextTime",
                    "formType": "datetime",
                    "name": "下次联系时间",
                    "type": 13,
                    "inputTips": null,
                    "maxLength": null,
                    "defaultValue": "",
                    "isUnique": 0,
                    "isNull": 0,
                    "options": null,
                    "fieldType": 1,
                    "operating": 191,
                    "companyId": "1685859946163859456",
                    "setting": [],
                    "authLevel": 3,
                    "value": null,
                    "sysInformation": null,
                    "isOut": null,
                    "isHidden": 0,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": 9,
                    "stylePercent": 50,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": null,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "name_resourceKey": "customField.contacts.nextTime"
                    },
                    "xaxis": -1,
                    "yaxis": -1
                },
                {
                    "fieldId": "1685859946633621539",
                    "parentFieldId": null,
                    "label": 3,
                    "fieldName": "sex",
                    "formType": "select",
                    "name": "性别",
                    "type": 3,
                    "inputTips": null,
                    "maxLength": null,
                    "defaultValue": "",
                    "isUnique": 0,
                    "isNull": 0,
                    "options": "男,女",
                    "fieldType": 2,
                    "operating": 191,
                    "companyId": "1685859946163859456",
                    "setting": [
                        "男",
                        "女"
                    ],
                    "authLevel": 3,
                    "value": null,
                    "sysInformation": null,
                    "isOut": null,
                    "isHidden": 0,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": 10,
                    "stylePercent": 50,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": null,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "0": "customField.contacts.sexOptions.男",
                        "1": "customField.contacts.sexOptions.女",
                        "name_resourceKey": "customField.contacts.sex"
                    },
                    "xaxis": -1,
                    "yaxis": -1
                },
                {
                    "fieldId": "1685859946633621538",
                    "parentFieldId": null,
                    "label": 3,
                    "fieldName": "remark",
                    "formType": "textarea",
                    "name": "备注",
                    "type": 2,
                    "inputTips": null,
                    "maxLength": 255,
                    "defaultValue": "",
                    "isUnique": 0,
                    "isNull": 0,
                    "options": null,
                    "fieldType": 1,
                    "operating": 191,
                    "companyId": "1685859946163859456",
                    "setting": [],
                    "authLevel": 3,
                    "value": null,
                    "sysInformation": null,
                    "isOut": null,
                    "isHidden": 0,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": 11,
                    "stylePercent": 50,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": null,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "name_resourceKey": "customField.contacts.remark"
                    },
                    "xaxis": -1,
                    "yaxis": -1
                },
                {
                    "fieldId": null,
                    "parentFieldId": null,
                    "label": null,
                    "fieldName": "ownerUserName",
                    "formType": "user",
                    "name": "负责人",
                    "type": 10,
                    "inputTips": null,
                    "maxLength": null,
                    "defaultValue": null,
                    "isUnique": null,
                    "isNull": null,
                    "options": null,
                    "fieldType": 1,
                    "operating": null,
                    "companyId": null,
                    "setting": [],
                    "authLevel": null,
                    "value": [
                        {
                            "userId": "1685859946243551232",
                            "img": null,
                            "realname": "admin",
                            "status": 1,
                            "deptId": "1685859946201608192",
                            "deptName": "admin",
                            "wxUserId": null,
                            "outerUserEmail": null
                        }
                    ],
                    "sysInformation": 1,
                    "isOut": null,
                    "isHidden": null,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": null,
                    "stylePercent": null,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": null,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "name_resourceKey": "customField.contacts.ownerUserName"
                    },
                    "xaxis": null,
                    "yaxis": null
                },
                {
                    "fieldId": null,
                    "parentFieldId": null,
                    "label": null,
                    "fieldName": "createUserName",
                    "formType": "user",
                    "name": "创建人",
                    "type": 10,
                    "inputTips": null,
                    "maxLength": null,
                    "defaultValue": null,
                    "isUnique": null,
                    "isNull": null,
                    "options": null,
                    "fieldType": 1,
                    "operating": null,
                    "companyId": null,
                    "setting": [],
                    "authLevel": null,
                    "value": [
                        {
                            "userId": "1685859946243551232",
                            "img": null,
                            "realname": "admin",
                            "status": 1,
                            "deptId": "1685859946201608192",
                            "deptName": "admin",
                            "wxUserId": null,
                            "outerUserEmail": null
                        }
                    ],
                    "sysInformation": 1,
                    "isOut": null,
                    "isHidden": null,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": null,
                    "stylePercent": null,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": null,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "name_resourceKey": "customField.contacts.createUserName"
                    },
                    "xaxis": null,
                    "yaxis": null
                },
                {
                    "fieldId": null,
                    "parentFieldId": null,
                    "label": null,
                    "fieldName": "createTime",
                    "formType": "datetime",
                    "name": "创建时间",
                    "type": 13,
                    "inputTips": null,
                    "maxLength": null,
                    "defaultValue": null,
                    "isUnique": null,
                    "isNull": null,
                    "options": null,
                    "fieldType": 1,
                    "operating": null,
                    "companyId": null,
                    "setting": [],
                    "authLevel": null,
                    "value": "2023-08-03 14:29:10",
                    "sysInformation": 1,
                    "isOut": null,
                    "isHidden": null,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": null,
                    "stylePercent": null,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": null,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "name_resourceKey": "customField.contacts.createTime"
                    },
                    "xaxis": null,
                    "yaxis": null
                },
                {
                    "fieldId": null,
                    "parentFieldId": null,
                    "label": null,
                    "fieldName": "updateTime",
                    "formType": "datetime",
                    "name": "更新时间",
                    "type": 13,
                    "inputTips": null,
                    "maxLength": null,
                    "defaultValue": null,
                    "isUnique": null,
                    "isNull": null,
                    "options": null,
                    "fieldType": 1,
                    "operating": null,
                    "companyId": null,
                    "setting": [],
                    "authLevel": null,
                    "value": "2023-08-04 13:41:35",
                    "sysInformation": 1,
                    "isOut": null,
                    "isHidden": null,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": null,
                    "stylePercent": null,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": null,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "name_resourceKey": "customField.contacts.updateTime"
                    },
                    "xaxis": null,
                    "yaxis": null
                },
                {
                    "fieldId": null,
                    "parentFieldId": null,
                    "label": null,
                    "fieldName": "lastTime",
                    "formType": "datetime",
                    "name": "最后跟进时间",
                    "type": 13,
                    "inputTips": null,
                    "maxLength": null,
                    "defaultValue": null,
                    "isUnique": null,
                    "isNull": null,
                    "options": null,
                    "fieldType": 1,
                    "operating": null,
                    "companyId": null,
                    "setting": [],
                    "authLevel": null,
                    "value": null,
                    "sysInformation": 1,
                    "isOut": null,
                    "isHidden": null,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": null,
                    "stylePercent": null,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": null,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "name_resourceKey": "customField.contacts.lastTime"
                    },
                    "xaxis": null,
                    "yaxis": null
                },
                {
                    "fieldId": null,
                    "parentFieldId": null,
                    "label": null,
                    "fieldName": "teamMemberIds",
                    "formType": "text",
                    "name": "相关团队",
                    "type": 1,
                    "inputTips": null,
                    "maxLength": null,
                    "defaultValue": null,
                    "isUnique": null,
                    "isNull": null,
                    "options": null,
                    "fieldType": 1,
                    "operating": null,
                    "companyId": null,
                    "setting": [],
                    "authLevel": null,
                    "value": "",
                    "sysInformation": 1,
                    "isOut": null,
                    "isHidden": null,
                    "autoGeneNumber": null,
                    "fieldDataId": null,
                    "sorting": null,
                    "stylePercent": null,
                    "maxNumRestrict": null,
                    "minNumRestrict": null,
                    "precisions": null,
                    "formPosition": null,
                    "formAssistId": null,
                    "optionsData": null,
                    "fieldExtendList": null,
                    "remark": null,
                    "isPhotograph": null,
                    "languageKeyMap": {
                        "name_resourceKey": "customField.contacts.teamMemberNames"
                    },
                    "xaxis": null,
                    "yaxis": null
                }
            ],
        }
    },
    inject: ['rootTabs'],
    computed: {},
    watch: {
        // id(val) {
        //     if (!this.filedList) {
        //         this.getBaseInfo(true)
        //     }
        // },

        // filedList() {
        //     this.list = this.filedList
        // },

        // 'rootTabs.currentName'(val) {
        //     if (val === 'CRMBaseInfo') {
        //         if (!this.filedList) {
        //             this.getBaseInfo(false)
        //         }
        //     }
        // }
    },
    created() {
        // this.$bus.on('crm-detail-update', (data) => {
        //     if (!this.filedList) {
        //         this.getBaseInfo(false)
        //     }
        // })


    },
    beforeDestroy() {
        // this.$bus.off('crm-detail-update')
    },
    mounted() {
        var baseList = []
        var systemList = []
        this.dataList.forEach(item => {
            if (item.formType === 'floatnumber') {
                item.value = separator(item.value)
            } else if (item.formType === 'date') {
                item.value = getWkDateTime(item.value)
            }
            if (item.sysInformation == 1) {
                systemList.push(item)
            } else {
                baseList.push(item)
            }
        })
        console.log(baseList)
        this.list = [
            {
                name: '基本信息',
                list: baseList
            },
            {
                name: '系统信息',
                list: systemList
            }
        ]
        console.log(this.list)
    },
    methods: {
        /**
         * 获取基础信息
         */
        // getBaseInfo(loading) {
        //     this.loading = !!loading
        //     if (this.crmType === 'marketing') {
        //         crmMarketingInformationAPI().then(res => {
        //             this.list = res.data
        //             this.loading = false
        //         }).catch(() => {
        //             this.loading = false
        //         })
        //     } else {
        //         const params = {
        //             types: crmTypeModel[this.crmType],
        //             id: this.id
        //         }

        //         // 如果有公海id 需上传确定展示字段
        //         if (this.poolId) {
        //             params.poolId = this.poolId
        //         }

        //         filedGetInformationAPI(params)
        //             .then(res => {
        //                 const baseList = []
        //                 const systemList = []
        //                 res.data.forEach(item => {
        //                     if (item.formType === 'floatnumber') {
        //                         item.value = separator(item.value)
        //                     } else if (item.formType === 'date') {
        //                         item.value = getWkDateTime(item.value)
        //                     }
        //                     if (item.sysInformation == 1) {
        //                         systemList.push(item)
        //                     } else {
        //                         baseList.push(item)
        //                     }
        //                 })

        //                 this.list = [
        //                     {
        //                         name: '基本信息',
        //                         list: baseList
        //                     },
        //                     {
        //                         name: '系统信息',
        //                         list: systemList
        //                     }
        //                 ]
        //                 this.loading = false
        //             })
        //             .catch(() => {
        //                 this.loading = false
        //             })
        //     }
        // },

        /**
         * 查看地图详情
         */
        // checkMapView(item) {
        //     if (item.value && item.value !== '') {
        //         this.mapViewInfo = {
        //             title: item.value.location,
        //             lat: item.value.lat,
        //             lng: item.value.lng
        //         }
        //         this.showMapView = true
        //     }
        // },

        // getArrayKey(type) {
        //     if (type === 'structure') {
        //         return 'name'
        //     } else if (type === 'user') {
        //         return 'realname'
        //     }

        //     return ''
        // },

        isModule(item) {
            return [
                'customer',
                'business',
                'contract',
                'contacts',
                'category',
                'statusName',
                'typeName'].includes(item.formType)
        },

        getShowBlock(type) {
            return ['map_address', 'file'].includes(type)
        },

        // getModuleName(item) {
        //     const field = {
        //         customer: 'customerName',
        //         business: 'businessName',
        //         contract: 'contractNum',
        //         contacts: 'contactsName',
        //         category: 'categoryName',
        //         statusName: 'statusName',
        //         typeName: 'typeName'
        //     }[item.formType]
        //     return item.value ? item.value[field] : ''
        // },

        /**
         * 查看详情
         */
        checkModuleDetail(data) {
            if (isObject(data.value)) {
                this.fullDetailType = data.formType
                this.fullDetailId = data.value[`${data.formType}Id`]
                this.showFullDetail = true
            }
        }
    }
}
</script>
  
<style lang="scss" scoped>
.vux-flexbox .vux-flexbox-item {
    flex: 50% !important;

}

.b-cont {
    position: relative;
    height: 100%;
    overflow-y: auto;
    overflow-y: overlay;
}

.b-cells .b-cells {
    margin-top: 24px;
}

.b-cell {
    padding: 0 10px;
}

.b-cell-b {
    width: auto;
    margin-bottom: 16px;

    .b-cell-name {
        flex-shrink: 0;
        width: 100px;
        padding-top: 3px;
        margin-right: 12px;
        line-height: 1.5;
        color: $--color-text-regular;
        text-align: right;
    }

    .b-cell-value {
        flex: 1;
        min-height: 32px;
        padding: 3px 6px;
        line-height: 1.5;
        word-break: break-all;
        word-wrap: break-word;
        white-space: pre-wrap;
        background-color: $--input-disabled-fill;
        border: $--border-width-medium $--border-style-base $--input-disabled-border;
        border-radius: $--input-border-radius;
    }

    .b-cell-foot {
        display: block;
        flex-shrink: 0;
        width: 15px;
        height: 15px;
        margin-left: 8px;
    }
}

.value-box {
    min-height: 32px;
    padding: 3px 6px;
    background-color: $--input-disabled-fill;
    border: $--border-width-medium $--border-style-base $--input-disabled-border;
    border-radius: $--input-border-radius;
}

.f-item {
    height: 25px;
    padding: 3px 0;

    .f-img {
        position: block;
        width: 15px;
        height: 15px;
        padding: 0 1px;
        margin-right: 8px;
    }

    .f-name {
        margin-right: 10px;
        color: $--color-n80;
    }
}

.can-check {
    color: $--color-primary !important;
    cursor: pointer;
}

::v-deep.section {
    margin-top: 0;

    .section-header {
        padding: 0;
        margin-bottom: $--interval-base;
    }

    .content {
        overflow: hidden;
    }
}
</style>
  